package org.jim.connector.jobs;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.jim.connector.command.CsAllocHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 订单自动完成
 *
 * @author tiger
 */
@Component
@Slf4j
public class JobsHandler {
    @Autowired
    private CsAllocHelper csAllocHelper;
    /**
     * 系统自动完成订单<br>
     * <li>对已发货状态的订单发货时间超过15个自然日的订单进行自动完成处理
     *
     * @Scheduled(cron = "0 5/10 * * * ?")
     */
    @XxlJob("csAllocHandler")
    public ReturnT<String> csAllocHandler(String s) throws Exception {
        log.info("taskSystemFinishOrder() start");
        csAllocHelper.offlineAlloc();
        return ReturnT.SUCCESS;
    }
}
